package com.rmi.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.api.IMixService;
import com.api.IOrderService;
import com.api.IUserService;
import com.api.req.OrderReq;
import com.api.resp.OrderResp;
import com.rmi.anno.server.RemoteService;
@RemoteService(serviceInterface=IMixService.class)
public class IMixServiceImpl implements IMixService {
	@Autowired
	private IUserService userService;
	@Autowired
	private IOrderService orderService;

	@Override
	public OrderResp mix(OrderReq orderReq, String name) {
		OrderResp resp = orderService.save(orderReq);
		resp.setDesc(resp.getDesc().concat("***"+userService.getUserByName(name)));
		return resp;
	}

}
